<!--
 * Created by PhpStorm.
 * 版权所有: 2019~2022 [ hhygyl ]
 * Date: 2019/6/28-9:24
 * Link: http://www.luckyhhy.cn
 * FileName: add_menu.html
 *-->

{extend name='public/window' /}


{block name="content"}

<div class="layui-fluid">
    <div class="layui-card">
        <!-- <div class="layui-card-header"></div>-->

        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="" lay-filter="component-form-group">

                <div class="layui-form-item">
                    <label class="layui-form-label label-required-next" >所属角色</label>
                    <div class="layui-input-block">

                        <select name="role_id" lay-search="" lay-verify="required" lay-vertype="tips" lay-reqtext="请选择等级">
                            {volist name="role" id="t"}
                            <option value="{$t.id}" {eq name="$t.id" value="1"} disabled {/eq}>{$t.name}</option>
                            {/volist}
                        </select>

                    </div>
                </div>

                {:token()}

                {:widget('common/forms/Pic',array('avatar|头像|请上传文头像|required|上传图片','',300,200))}

                <div class="layui-form-item">
                    <label class="layui-form-label label-required-next">管理员昵称：</label>
                    <div class="layui-input-inline input-custom-width" style="">
                        <input type="text" name="nickname" value="" placeholder="请输入管理员昵称" lay-verify="required" lay-vertype="tips" lay-reqtext="请输入管理员昵称" autocomplete="off" class="layui-input ">
                    </div>
                    <label class="layui-form-label label-required-next">管理员用户名：</label>
                    <div class="layui-input-inline input-custom-width" style="">
                        <input type="text" name="username" value="" placeholder="请输入管理员用户名" lay-verify="required" lay-vertype="tips" lay-reqtext="请输入管理员用户名" autocomplete="off" class="layui-input ">
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label label-required-next">登录密码：</label>
                    <div class="layui-input-inline input-custom-width" style="">
                        <input type="password" name="password" value="" placeholder="请输入登录密码" lay-verify="required" lay-vertype="tips" lay-reqtext="请输入登录密码" autocomplete="off" class="layui-input ">
                    </div>

                    <label class="layui-form-label label-required-next">确认密码：</label>
                    <div class="layui-input-inline input-custom-width" style="">
                        <input type="password" name="repassword" value="" placeholder="请输入确认密码" lay-verify="required" lay-vertype="tips" lay-reqtext="请输入确认密码" autocomplete="off" class="layui-input ">
                    </div>
                </div>



                <div class="layui-form-item">
                    <label class="layui-form-label">性别：</label>
                    <div class="layui-input-inline">
                        <select name="sex" lay-verify="required" >
                            <option value="男" >男</option>
                            <option value="女" >女</option>
                            <option value="保密" >保密</option>
                        </select>
                    </div>

                    <label class="layui-form-label">状态：</label>
                    <div class="layui-input-inline input-custom-width">
                        <input type="radio" name="status" value="1" title="正常" lay-filter=""  checked>
                        <input type="radio" name="status" value="2" title="拉黑" lay-filter="" >
                    </div>

                    <div class="layui-form-mid layui-word-aux"></div>
                </div>

                {:widget('common/forms/submit',array('add','立即提交',2))}

            </form>
        </div>
    </div>
</div>



<script>
    layui.use(['element', 'form', 'jquery','lucky'], function () {
        var element = layui.element;
        var table = layui.table;
        var form = layui.form;
        var $ = layui.jquery;
        var lucky=layui.lucky;

        form.on('submit(add)', function (data) {
            lucky.FormSubmit("{:url('addUser')}",data.field,"table_id",1);

            return false;
        });
    })
</script>

{/block}

